// GraphThread.cpp : implementation file
//

#include "stdafx.h"
#include "LoPlayer.h"
#include "GraphThread.h"
#include "OpenMediaData.h"
#include "MainFrm.h"

// CGraphThread

IMPLEMENT_DYNCREATE(CGraphThread, CWinThread)

CGraphThread::CGraphThread()
: m_pMainFrame(NULL)
{
}

CGraphThread::~CGraphThread()
{
}

BOOL CGraphThread::InitInstance()
{
	// TODO:  perform and per-thread initialization here
	// Initialize OLE libraries
	if (!AfxOleInit()) {
		AfxMessageBox(IDP_OLE_INIT_FAILED);
		return FALSE;
	}

	return TRUE;
}

int CGraphThread::ExitInstance()
{
	// TODO:  perform any per-thread cleanup here
	return CWinThread::ExitInstance();
}

BEGIN_MESSAGE_MAP(CGraphThread, CWinThread)
	ON_THREAD_MESSAGE(TM_FRAME, OnSetFrame)
	ON_THREAD_MESSAGE(TM_OPEN, OnOpen)
	ON_THREAD_MESSAGE(TM_CLOSE, OnClose)
END_MESSAGE_MAP()


// CGraphThread message handlers
void CGraphThread::OnOpen(WPARAM wParam, LPARAM lParam)
{
}

void CGraphThread::OnClose(WPARAM wParam, LPARAM lParam)
{
}

void CGraphThread::OnSetFrame( WPARAM wParam, LPARAM lParam )
{
	ASSERT(!m_pMainFrame);
	m_pMainFrame = (CMainFrame*)lParam;
}
